
<script>

var mydialog = art.dialog;
function showImgBox(curElement){
	art.dialog.data('curElement',curElement);
	
	<if condition="!isMobile()">
	
	art.dialog.open('{:U('Img/imagesBox')}', {width: 800, height: 500,lock:true,title:'选择图片', ok:function(){
			var d = this.iframe.contentWindow.document;
			var img_url = $(d).find('#Imgselected').attr('img_url');
			$(curElement).parent().find("input").eq(0).val(img_url);
			$(curElement).val('__PUBLIC__'+img_url);
			$(curElement).focus();
			$(curElement).blur();
			curElement.src = '__PUBLIC__'+img_url;
	},close:function(){
		<if condition="isMobile()"> 
			
			if($(".auii_statei_focus").length > 1){
				$(".auii_statei_focus.index"+($(".aui_state_focus").attr("index")*1 - 1)).show().addClass("aui_state_focus");
			}else{
				$("html,body").animate({scrollTop:$.cookie("scroll_hidden")},100);
				$(".modal-shiftfix").removeClass("hidden");
				$("body").removeClass("padding0");
			}
			
			<else/>
			
			if($(".aui_state_lock").length > 0){
			    $(".aui_state_lock").addClass("aui_state_focus");
			}else{
				$("html,body").animate({scrollTop:$.cookie('scroll_hidden')},100);
				$('.modal-shiftfix').removeClass('hidden');
				$('body').removeClass('padding0');
			}
			</if>
		}});
	<else/>
	mydialog.open("{:U('Img/imagesBox')}", {
		width:$(window).width(), id:'imagesBox', height: 300,lock:true,title:'上传图片',yesClose:false, ok:function(){
		var d = this.iframe.contentWindow.document;
		
		
		if($(d).find('#Imgselected').length > 0){
			var img_url = $(d).find('#Imgselected').attr('img_url');
			$(curElement).parent().find("input").eq(0).val(img_url);
			$(curElement).val('__PUBLIC__'+img_url);
			$(curElement).focus();
			$(curElement).blur();
			curElement.src = '__PUBLIC__'+img_url;
			mydialog.list['imagesBox'].close();
			return false;
		}
		
		
		$.post(
		"{:U('Img/Jcrop')}",
		{	type:$(d).find('#type').val(),
			x:$(d).find('#x').val(),
		    y:$(d).find('#y').val(),
			w:$(d).find('#w').val(),
			h:$(d).find('#h').val(),
			src:$(d).find('#img_src').val()
			},
			function(data){
			if(data == 'OK'){
				
				var img_url = $(d).find('#img_src').val().replace('__PUBLIC__', '');
				$(curElement).parent().find("input").eq(0).val(img_url);
				$(curElement).val(img_url);
				$(curElement).focus();
				$(curElement).blur();
				curElement.src = '__PUBLIC__'+img_url;
				
				mydialog.list['imagesBox'].close();
			}
		}
		); 
	}});
	</if>
}


			 
//链接选择框
function showLinkBox(curElement){
	art.dialog.data('curElement',curElement);
	art.dialog.open('{:U('Index/showLink')}', {width: 800, height: 500,lock:true,title:'选择链接'});
}
//链接选择框
function showIconBox(curElement){
	art.dialog.data('curElement',curElement);
	art.dialog.open('{:U('Index/showIcon')}', {width: 800, height: 500,lock:true,title:'选择图标'});
}

  

</script>

<form action="{:U($tablename.'/add')}" method="post" class="checkoutform">
<input type="hidden" name="id" value="{$cur_setting.id}" />
<input type="hidden" name="pid" value="{$parent_id}" />
    <input type="hidden" name="modules_id" value="{$modules_id}" />
    
    
    
   
     <volist name="list" id="svo">
    <neq name="svo['fieldname']" value="sort">
    
    <div class="form-group">
      <label class="control-label">{$svo.remark}</label>
      <div>
         <!--单行文本框-->
    <eq name="svo['type']" value="0">
    
        <if condition="$svo['fieldname'] eq 'link' or $svo['fieldname'] eq 'icon'">
        
        
        <eq name="svo['fieldname']" value="link">
        
        
        <div class="row">
            <div class="col-sm-8 col-xs-9"><input name="{$svo.fieldname}" class="form-control" dataType="<notempty name="svo['vtype']">{$svo.vtype}"</notempty> type="text" value="{$cur_setting[$svo['fieldname']]}" size="60" /></div>
            
            <div class="col-sm-4 col-xs-3"><a href="javascript:void(0);" onClick="showLinkBox(this);" class="btn btn-success">选择</a></div>
        </div>
        <else/>
        
        <div class="row">
            <div class="col-sm-8 col-xs-9"><input name="{$svo.fieldname}" class="form-control" <notempty name="svo['vtype']">dataType="{$svo.vtype}"</notempty> type="text" value="{$cur_setting[$svo['fieldname']]}" size="60" /></div>
            
            <div class="col-sm-4 col-xs-3"><a href="javascript:void(0);" onClick="showIconBox(this);" class="btn btn-success">选择</a></div>
        </div>
        </eq>
       
        
        
        <else/>
        

        <input name="{$svo.fieldname}" class="form-control" <notempty name="svo['vtype']">dataType="{$svo.vtype}"</notempty> type="text" value="{$cur_setting[$svo['fieldname']]}" size="60" />
        
        </if>
        
    </eq>
  <!--下拉框-->
    <eq name="svo['type']" value="2">
        <html:select name="{$svo['fieldname']}" style="form-control" options="svo['_select']" selected="cur_setting[$svo['fieldname']]" />
    </eq>
    <!--编辑框-->
    <eq name="svo['type']" value="3">
        <html:editor id="{$svo['fieldname']}_" name="{$svo['fieldname']}" type="UEDIT" style="width:100%;">{$cur_setting[$svo['fieldname']]}</html:editor>
    </eq>
    <!--多行文本-->
    <eq name="svo['type']" value="1">
        <textarea name="{$svo.fieldname}" class="form-control" cols="60" rows="6">{$cur_setting[$svo['fieldname']]}</textarea>
    </eq>
    <!--上传图片-->
    <eq name="svo['type']" value="4">
        <script>
			function uploaded{$svo.fieldname}(path,name){
				$("#"+name).attr("src",'__PUBLIC__'+path);
				$("input[name='"+name+"']").val(path);
			}
			function del_img{$svo.fieldname}(name){
				if(confirm('您确定要删除图片吗?')){
					var file=$("input[name='"+name+"']").val();
					$.post("{:U('delImgBypath')}",{'path':file},function(data){
						$("input[name='"+name+"']").val('');
						$("#"+name).attr('src','');
					});
				}else{
					return false;
				}
			}
		</script>
        <input type="hidden" name="{$svo.fieldname}" value="{$cur_setting[$svo['fieldname']]}" />
        
        <img style="max-width:200px" onclick="showImgBox(this);" src="<notempty name="cur_setting[$svo['fieldname']]">{:getThumbPath($cur_setting[$svo['fieldname']])}<else/>__PUBLIC__/Admin/images/defaultimg.png</notempty>" id="{$svo.fieldname}" height="80" />
    </eq>
    <!--图片上传结束-->
    <!--布局编辑框-->
    <eq name="svo['type']" value="6">
        <div style="" onclick="openthis(this);"><html:editor id="{$svo['fieldname']}" name="{$svo['fieldname']}" type="CHENHUIEDITOR" width="100%" height="500">{$cur_setting[$svo['fieldname']]}</html:editor></div>
    </eq>
    <!-- 布局编辑器结束 -->
      </div>
   </div>
</neq>
</volist>


    
    
    
    
    
    
    
    
    
    
    
    
    
    
</form>
